package com.jeethink.erp.pile.service.impl;

import java.util.List;
import com.jeethink.common.utils.DateUtils;
import com.jeethink.erp.pile.service.ITbStockPileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeethink.erp.pile.mapper.TbStockPileMapper;
import com.jeethink.erp.pile.domain.TbStockPile;

/**
 * 库存Service业务层处理
 * 
 * @author ypr
 * @date 2021-05-26
 */
@Service
public class TbStockPileServiceImpl implements ITbStockPileService
{
    @Autowired
    private TbStockPileMapper tbStockPileMapper;

    /**
     * 查询库存
     * 
     * @param stockPileId 库存ID
     * @return 库存
     */
    @Override
    public TbStockPile selectTbStockPileById(Long stockPileId)
    {
        return tbStockPileMapper.selectTbStockPileById(stockPileId);
    }

    /**
     * 查询库存列表
     * 
     * @param tbStockPile 库存
     * @return 库存
     */
    @Override
    public List<TbStockPile> selectTbStockPileList(TbStockPile tbStockPile)
    {
        return tbStockPileMapper.selectTbStockPileList(tbStockPile);
    }

    /**
     * 新增库存
     * 
     * @param tbStockPile 库存
     * @return 结果
     */
    @Override
    public int insertTbStockPile(TbStockPile tbStockPile)
    {
        tbStockPile.setCreateTime(DateUtils.getNowDate());
        return tbStockPileMapper.insertTbStockPile(tbStockPile);
    }

    /**
     * 修改库存
     * 
     * @param tbStockPile 库存
     * @return 结果
     */
    @Override
    public int updateTbStockPile(TbStockPile tbStockPile)
    {
        tbStockPile.setUpdateTime(DateUtils.getNowDate());
        return tbStockPileMapper.updateTbStockPile(tbStockPile);
    }

    /**
     * 批量删除库存
     * 
     * @param stockPileIds 需要删除的库存ID
     * @return 结果
     */
    @Override
    public int deleteTbStockPileByIds(Long[] stockPileIds)
    {
        return tbStockPileMapper.deleteTbStockPileByIds(stockPileIds);
    }

    /**
     * 删除库存信息
     * 
     * @param stockPileId 库存ID
     * @return 结果
     */
    @Override
    public int deleteTbStockPileById(Long stockPileId)
    {
        return tbStockPileMapper.deleteTbStockPileById(stockPileId);
    }
}
